package com.deram.ctin.serv.business.api;

import com.deram.ctin.serv.business.entity.BaseUpdateInfo;
import com.deram.ctin.serv.business.entity.BusinessInfo;
import com.deram.ctin.serv.business.filter.BusinessInfoFilter;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/13 15:43
 * @version: V1.0
 */
@FeignClient("serv-business")
@RequestMapping("/businessInfoApi")
public interface BusinessInfoApi {

    @PostMapping("/find")
    BusinessInfo find(@RequestParam("enterId") Long enterId);

    @PostMapping("/findByYear")
    BusinessInfo findByYear(@RequestParam("enterId") Long enterId, @RequestParam("year") Integer year);

    @PostMapping("/list")
    List<BusinessInfo> list(@RequestBody BusinessInfoFilter filter);

    @PostMapping("/save")
    BusinessInfo save(@RequestBody BusinessInfo param);

    @PostMapping("/insertList")
    void insertList(@RequestBody BaseUpdateInfo<BusinessInfo> param);

    @PostMapping("/delete")
    void delete(@RequestParam("enterId") Long enterId);

    @PostMapping("/enterId")
    List<Integer> listYear(@RequestParam("enterId") Long enterId);
}
